package org.itboys.core.entity.mysql.order;

import lombok.Data;
import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mysql.entity.BaseMySqlEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 作者：zzq
 * 时间：2018/12/7
 * 描述：回收订单
 */
@Data
public class SundayRecycleOrder extends BaseMySqlEntity {
    private Long sendOrderId;//配送订单id
    private String sendOderNo;//配送订单编号
    private Long memberId;//用户id
    private String memberName;//用户名称
    private Long serviceId;//供应商id
    private String serviceName;//供应商名称
    private Long storeId;//仓库id
    private String storeName;//仓库名称
    private String storeAddress;//仓库地址
    private String orderNo;//订单编号

    private String startTime;//开始时间
    private String endTime;//结束时间
    private String mobile;//租赁电话
    private Integer type;//租赁方式  1，日租  2，月租  3，季租
    private Long time;//时间  多少天  多少月
    private BigDecimal totalAmount;//收入

    private String recycleDate;//回收时间
    private Long recycleProvinceId;//回收省份id
    private String recycleProvince;//回收省份
    private Long recycleCityId;//回收城市id
    private String recycleCity;//回收城市
    private Long recycleDistrictId;//回收区域id
    private String recycleDistrict;//回收区域
    private String recycleAddress;//回收地址

    private Integer status;//状态

    private Date confirmTime;//确认时间
    private Date sendTime;//发盘时间
    private Date receiveTime;//收盘时间


    public String  getStatusStr(){
        String statusStr= "";
        if(status==null)return statusStr;

        switch (status) {
            case 1:
                statusStr="待确认";
                break;
            case 2:
                statusStr="已确认";
                break;
            case 3:
                statusStr="已回收";
                break;
            case 4:
                statusStr="已收盘";
                break;
            default:
                break;
        }
        return statusStr;
    }


    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;
        switch (type) {
            case 1:
                typeStr="日租";
                break;
            case 2:
                typeStr="月租";
                break;
            case 3:
                typeStr="季租";
                break;
            default:
                break;
        }
        return typeStr;
    }

    public String getReceiveTimeStr() {

        return TimeUtils.format(receiveTime,"yyyy-MM-dd HH:mm:ss");
    }

    public String getSendTimeStr() {

        return TimeUtils.format(sendTime,"yyyy-MM-dd HH:mm:ss");
    }

    public String getConfirmTimeStr() {

        return TimeUtils.format(confirmTime,"yyyy-MM-dd HH:mm:ss");
    }
}
